Next | Prev | Up | Top | Contents | Index

The Frame Scheduler API

The details of the Frame Scheduler API can be found in the frs(3) reference page. The API elements are declared in /usr/include/sys/frs.h. The following are some important types are declared in /usr/include/sys/frs.h:

typedef frs_fsched_info_tA structure containing information about one scheduler, including its CPU number, time base, and number of minor frames. Used when creating a Frame Scheduler.
typedef frs_tA structure containing an frs_fsched_info_t and the process ID of the frs control of the master Frame Scheduler. Used to create or specify any Frame Scheduler.
typedef frs_queue_info_tA structure containing information about one activity process: the Frame Scheduler and minor frame it uses and its scheduling discipline. Used when enqueuing a process.
typedef frs_recv_info_tA structure containing error recovery options.


Library Interface for C Programs

The API library functions in /usr/lib/libfrs.so are summarized in Table 7-1 on "Library Interface for C Programs" for convenient reference.

Frame Scheduler Operations
OperationApplication Interface Options
Create a Frame Schedulerfrs_t* frs_create(int cpu, int intr_source, int intr_qualifier, int n_minors,
pid_t sync_master_pid, int num_slaves);
frs_t* frs_create_master(int cpu, int intr_source, int intr_qualifier, int n_minors,
int num_slaves);
frs_t* frs_create_slave(int cpu, frs_t* sync_master_frs);
Enqueue an activity process to a Frame Schedulerint frs_enqueue(frs_t* frs, pid_t pid, int minor_index, uint discipline);
Join a Frame Scheduler (activity is ready to start)int frs_join(frs_t* frs);
Start scheduling (all activities enqueued)int frs_start(frs_t* frs);
Yield control after completing activityint frs_yield(void);
Pause scheduling at end of minor frameint frs_stop(frs_t* frs);
Resume scheduling at next time-base interruptint frs_resume(frs_t* frs):
Destroy a Frame Scheduler and send SIGKILL to its FRS control processint frs_destroy(frs_t* frs);
Interrogate a process queueint frs_getqueuelen(frs_t* frs, int minor_index);
int frs_readqueue(frs_t* frs, int minor_index, pid_t* pidlist);
Remove a process from a queueint frs_premove(frs_t* frs, int minor_index, pid_t remove_pid);
Reinsert a process in a queue, possibly changing disciplineint frs_pinsert(frs_t* frs, int minor_index, pid_t insert_pid, int discipline, pid_t base_pid);
Retrieve error-recovery optionsint frs_getattr( frs_t* frs, int minor_index, pid_t pid, frs_attr_t att_index, frs_recv_info_t* options);
Set error-recovery optionsint frs_setattr( frs_t* frs, int minor_index, pid_t pid, frs_attr_t att_index, frs_recv_info_t* options);


System Call Interface for Fortran and Ada

Each Frame Scheduler function is available in two ways: as a system call to schedctl(), or as one or more library calls to functions in the frs library, /usr/lib/libfrs.so. The system call is accessible from FORTRAN and Ada programs because both languages have bindings for schedctl() (see the schedctl(2) reference page). The correspondence between the library functions and schedctl() calls is shown in Table 7-2.

Frame Scheduler schedctl() Support
Library FunctionSchedctl Syntax
frs_create() int schedctl(MPTS_FRS_CREATE, frs_info_t* frs_info);
frs_enqueue() int schedctl(MPTS_FRS_ENQUEUE, frs_queue_info_t* frs_queue_info);
frs_join() int schedctl(MPTS_FRS_JOIN, pid_t frs_master);
frs_start() int schedctl(MPTS_FRS_START, pid_t frs_master);
frs_yield() int schedctl(MPTS_FRS_YIELD);
frs_stop() int schedctl(MPTS_FRS_STOP, pid_t frs_master);
frs_resume() int schedctl(MPTS_FRS_RESUME, pid_t frs_master);
frs_destroy() int schedctl(MPTS_FRS_DESTROY, pid_t frs_master);
frs_getqueuelen() int schedctl(MPTS_FRS_GETQUEUELEN, frs_queue_info_t* frs_queue_info);
frs_readqueue() int schedctl(MPTS_FRS_READQUEUE, frs_queue_info_t* frs_queue_info,
pid_t* pidlist);
frs_premove() int schedctl(MPTS_FRS_PREMOVE, frs_queue_info_t* frs_queue_info);
frs_pinsert() int schedctl(MPTS_FRS_PINSERT, frs_queue_info_t* frs_queue_info,
pid_t *base_pid);
frs_getattr() int schectl(MPTS_FRS_GETATTR, frs_attr_info_t* frs_attr_info);
frs_setattr() int schectl(MPTS_FRS_SETATTR, frs_attr_info_t* frs_attr_info);


Next | Prev | Up | Top | Contents | Index